import java.io.*;
import java.net.Socket;
import java.util.Scanner;

/**
 * 客户端从恒旭，连接服务器，收发消息
 */

public class ChatClient3 {

    public static void main(String[] args) {

        Socket s = null;
        BufferedWriter bw = null;
        BufferedReader br = null;

        try {
            //指定端口和地址
            s = new Socket("192.168.1.60",8888);
            //包装输入输出流，用作参数传递
            br = new BufferedReader(new InputStreamReader(s.getInputStream()));
            bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));

            SeThread st = new SeThread(bw);    //发送线程类
            ReThread rt = new ReThread(br);    //接收线程类


            //启动发送接收线程
            new Thread(new SeThread(bw)).start();
            new Thread(new ReThread(br)).start();

        } catch (IOException e) {
            e.printStackTrace();
        } finally {

        }
    }


}
